package com.jws.jawestshow;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
//import android.jws.JwsHardwareManager;
//import android.jws.JwsHardwareListener;
//import android.jws.JwsCard;
import android.widget.Button;

import com.jws.thirdlibrary.CxManager;

public class WriteWiegandActivity extends Activity {
//	static final String WIEGAND26 = "/sys/devices/platform/jws_wiegand/wiegand26";
//	static final String WIEGAND34 = "/sys/devices/platform/jws_wiegand/wiegand34";

    static final String DATA26 = "16777215";/*111111111111111111111111*/
    static final String DATA34 = "1763311530";


    private Button mButtonWriteWiegand26;
    private Button mButtonWriteWiegand34;
    private TextView mCardID;
    private CxManager mCxManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_writewiegand);
        mCxManager = mCxManager.create(this);
        initButton();
    }

    private void initButton() {
        mButtonWriteWiegand26 = (Button) findViewById(R.id.write_wiegand26);
        mButtonWriteWiegand34 = (Button) findViewById(R.id.write_wiegand34);
        mButtonWriteWiegand26.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                mCxManager.jwsSendWieg26Data(DATA26);
            }
        });

        mButtonWriteWiegand34.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                mCxManager.jwsSendWieg34Data(DATA34);
            }
        });

    }

}
